package com.tanhua.model.vo;

import com.tanhua.model.db.Report;
import com.tanhua.model.db.UserInfo;
import com.tanhua.model.mongo.Movement;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.util.StringUtils;

import java.text.SimpleDateFormat;
import java.util.*;

/**
 * @author lamy
 * @version 1.0
 * @ClassName: SoulResultVo
 * @date 2021-12-27 19:36:48
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SoulResultVo {
    private String conclusion;
    private String cover;
    private List<Map> dimensions; //维度
    private List<SimilarVo> similarYou; //与你相识


    public static SoulResultVo init(Report report) {
        SoulResultVo vo = new SoulResultVo();
        vo.setConclusion(report.getConclusion());
        vo.setCover(report.getCover());
        List<Map> mapList = new ArrayList<>();
        Map<String, String> perceptualMap = new HashMap<>();
        perceptualMap.put("key", "感性");
        perceptualMap.put("value", report.getPerceptual()+"%");
        mapList.add(perceptualMap);
        Map<String, String> rationalmap = new HashMap<>();
        rationalmap.put("key", "理性");
        rationalmap.put("value", report.getRational()+"%");
        mapList.add(rationalmap);
        Map<String, String> extroversionMap = new HashMap<>();
        extroversionMap.put("key", "外向");
        extroversionMap.put("value", report.getExtroversion()+"%");
        mapList.add(extroversionMap);
        Map<String, String> JudgeMap = new HashMap<>();
        JudgeMap.put("key", "感性");
        JudgeMap.put("value", report.getJudge()+"%");
        mapList.add(JudgeMap);
        vo.setDimensions(mapList);
        return vo;
    }
}
